package com.construction.api.exception;

import com.construction.api.enums.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author dybin
 * @description
 * @date 2021/7/2 10:47
 **/
@Data
@AllArgsConstructor
public class BusinessException extends BaseException {

    private ResultEnum resultEnum;

    public BusinessException(ResultEnum resultEnum, String s) {
        super(s);
        this.resultEnum = resultEnum;
    }

    public static BusinessException of(ResultEnum resultEnum) {
        return new BusinessException(resultEnum);
    }

    public static <T> BusinessException of(ResultEnum resultEnum, String msg) {
        return new BusinessException(resultEnum, msg);
    }

}
